home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1994
/
MacHack 1994.toast
/
MacHack™94
/
Talks & Papers
/
Timothy Knox
/
yerk 3.66
/
Asm source
/
LoadACodes
< prev
next >
Wrap
Text File
|
1994-06-24
|
2KB
|
58 lines
\ Asm Codes Loader Reese Warner 3/85
\ 9/11/85 RW Added type26
50 Dictionary codes
: BuildCodes { \ bytecode type objaddr ct -- }
0 -> ct
query: topfile drop
BEGIN
@word count put: token \ gets opcode name
binary @word number drop -> bytecode \ gets bits for opcode
decimal @word number drop -> type \ gets type of operation
type
CASE
1 OF heap> type1 ENDOF \ finishes typing
2 OF heap> type2 ENDOF
3 OF heap> type3 ENDOF \ heap>
4 OF heap> type4 ENDOF \ makes object of type n and ptr
5 OF heap> type5 ENDOF \ to it is on the stack
6 OF heap> type6 ENDOF
7 OF heap> type7 ENDOF
8 OF heap> type8 ENDOF
9 OF heap> type9 ENDOF
10 OF heap> type10 ENDOF
11 OF heap> type11 ENDOF
12 OF heap> type12 ENDOF
13 OF heap> type13 ENDOF
14 OF heap> type14 ENDOF
15 OF heap> type15 ENDOF
16 OF heap> type16 ENDOF
18 OF heap> type18 ENDOF
19 OF heap> type19 ENDOF
20 OF heap> type20 ENDOF
21 OF heap> type21 ENDOF
22 OF heap> type22 ENDOF
23 OF heap> type23 ENDOF
24 OF heap> type24 ENDOF
26 OF heap> type26 ENDOF
27 OF heap> type27 ENDOF
ENDCASE -> objAddr
bytecode init: objAddr \ reads reast of input line
objAddr token enter: codes
query: topFile
UNTIL
;
: LoadCodes { addr len -- }
new: loadFile addr len name: topFile
open: topFile \ open "AsmCodes"
0<
IF
200 AsmError \ check for bad file
THEN
buildCodes
close: topFile drop \ close "asmcodes"
remove: loadFile
;